<div ng-include="'components/navbar/navbar.html'"></div>

<div class="container">
  <div class="row">
    <div class="col-sm-12">
      <h4 id='loginTitle'>Login</h4>
     
    </div>
    <div class="col-sm-12">
      <form class="form" name="form" ng-submit="login(form)" novalidate>

        <div class="form-group">
          <div class="input-field col s12">
            <input name='email' type="email" class="validate" ng-model="user.email" required/>
            <label for="email" class='active'>Email</label>
          </div>      
        </div>

        <div class="form-group">
           <div class="input-field col s12">
            <input name='password' type="password" class="validate" ng-model="user.password" required/>
            <label for="password" class='active'>Password</label>
          </div> 
        </div>

          
        <div class="form-group has-error">
          <p class="help-block" ng-show="form.email.$error.required && form.password.$error.required && submitted">
             Please enter your email and password.
          </p>
          <p class="help-block" ng-show="form.email.$error.email && submitted">
             Please enter a valid email.
          </p>

          <p class="help-block">{{ errors.other }}</p>
        </div>

        <div>
          <button class="btn btn-inverse btn-lg btn-login" type="submit">
            Login
          </button>
          <a class="btn btn-default btn-lg btn-register" href="/signup">
            Register
          </a>
        </div>

        <hr>
        <div>
          <a class="btn btn-facebook" href="" ng-click="loginOauth('facebook')">
            <i class="fa fa-facebook"></i> Connect with Facebook
          </a>
          <a class="btn btn-google-plus" href="" ng-click="loginOauth('google')">
            <i class="fa fa-google-plus"></i> Connect with Google+
          </a>
          <a class="btn btn-twitter" href="" ng-click="loginOauth('twitter')">
            <i class="fa fa-twitter"></i> Connect with Twitter
          </a>
        </div>
      </form>
    </div>
  </div>
  <hr>
</div>
